package org.brisling.task.service;

import java.util.Date;

import org.brisling.common.SysConfig;
import org.brisling.satisfaction.queryService.QuerySatisEvaluateHisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class SatifaRankScheduledService {

	@Autowired 
	private QuerySatisEvaluateHisService qrySatisEvaluateHisService;
	
	@Scheduled(cron="0 0 2 ? * *")
	public void autoProvide()
	{	
		//禁用日志
		SysConfig.setEnableLog(false);
		 String userId = SysConfig.getConfig("inquiryUserId");
	     String bizcodes[] = new String[6];
		 bizcodes[0] = "satis_window";
		 bizcodes[1] = "satis_outpatient_question";
		 bizcodes[2] = "satis_inpatient";
		 //bizcodes[3] = "satis_inpatient_question";
		 for (int i = 0; i < 4; i++)
		 {
			 if (i == 3)
				 continue;
			 String bizcode = bizcodes[i];
			 if (userId != null)
				 qrySatisEvaluateHisService.autoSend(userId, bizcode, new Date(), new Date());
		 }
	}	 
}
